home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue57 / DragDrop / ExeFormU.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-03-23  |  1.1 KB  |  54 lines

  1. unit ExeFormU;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls;
  8.  
  9. type
  10.   TExeForm = class(TForm)
  11.     btnShowOtherForm: TButton;
  12.     Edit1: TEdit;
  13.     Label1: TLabel;
  14.     procedure btnShowOtherFormClick(Sender: TObject);
  15.     procedure Edit1DragOver(Sender, Source: TObject; X, Y: Integer;
  16.       State: TDragState; var Accept: Boolean);
  17.     procedure Edit1DragDrop(Sender, Source: TObject; X, Y: Integer);
  18.   private
  19.     { Private declarations }
  20.   public
  21.     { Public declarations }
  22.   end;
  23.  
  24. var
  25.   ExeForm: TExeForm;
  26.  
  27. implementation
  28.  
  29. uses
  30.   DLLDragObject;
  31.  
  32. {$R *.DFM}
  33.  
  34. procedure ShowForm(Wnd: HWnd); stdcall;
  35. external 'DllDrag.Dll';
  36.  
  37. procedure TExeForm.btnShowOtherFormClick(Sender: TObject);
  38. begin
  39.   ShowForm(Application.Handle)
  40. end;
  41.  
  42. procedure TExeForm.Edit1DragOver(Sender, Source: TObject; X, Y: Integer;
  43.   State: TDragState; var Accept: Boolean);
  44. begin
  45.   Accept := IsDragObject(Source)
  46. end;
  47.  
  48. procedure TExeForm.Edit1DragDrop(Sender, Source: TObject; X, Y: Integer);
  49. begin
  50.   (Sender as TCustomEdit).Text := TTextDragObject(Source).Data
  51. end;
  52.  
  53. end.
  54.